package whu.edu.demo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;
import whu.edu.demo.domain.Role;
import whu.edu.demo.domain.Users;
/**
 * @author 86159
 */
@Mapper
public interface userDao extends BaseMapper<Users> {

    @Select("select password from user where username = #{username}")
    public String getPasswordByUsername(String username);
    @Select("select rolename, remark from ur , roles where username = #{username} and rolename = name")
    @Results({@Result(property = "name",column = "rolename"),@Result(property = "remark",column = "remark")})
    public IPage<Role> getRolesByUsername(IPage<Role> page, String username);
}

